package com.github.kylewka.smartai.mcp.spring.support;

import java.lang.reflect.Method;
import java.util.List;

/**
 * McpFunctionInfo
 * MCP方法信息
 *
 * @author kylewka
 * @since 2025/4/28
 */
public class McpFunctionInfo {

    private final String          name;
    private final String          description;
    private final Method          method;
    private final List<ParamInfo> params;

    public McpFunctionInfo(String name, String description, Method method, List<ParamInfo> params) {
        this.name = name;
        this.description = description;
        this.method = method;
        this.params = params;
    }

    public String getName() {
        return name;
    }

    public String getDescription() {
        return description;
    }

    public Method getMethod() {
        return method;
    }

    public List<ParamInfo> getParams() {
        return params;
    }

    public static class ParamInfo {

        private final String   name;
        private final String   description;
        private final String[] enums;
        private final boolean  required;

        public ParamInfo(String name, String description, String[] enums, boolean required) {
            this.name = name;
            this.description = description;
            this.enums = enums;
            this.required = required;
        }

        public String getName() {
            return name;
        }

        public String getDescription() {
            return description;
        }

        public String[] getEnums() {
            return enums;
        }

        public boolean isRequired() {
            return required;
        }
    }

}
